package com.example.test.advice.第五章_数组和集合.建议73_使用Comparator进行排序;

import java.util.Comparator;

public class PositionComparator implements Comparator<Employee> {

    @Override
    public int compare(Employee o1, Employee o2) {
        //按照职位降序排序
        return o1.getPosition().compareTo(o2.getPosition());
    }
}
